﻿@{
    ViewBag.Title = "Tender Analysis - Supply Chain Management System";
    Layout = "~/Views/Shared/_GeneralLayout.cshtml";
}

<div id="budgetsMain" class="contentMain">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td width="50%" align="center">
                <div id="popupDiv" class="popup" style="display: none;">
                </div>
            </td>
            <td width="50%">
            </td>
        </tr>
    </table>
    <div class="contentHeader">
        <div class="headerText">
            <h3 class="title-left">
                Tender Analysis</h3>
        </div>
        <div style="font-size: 13px; text-align: left;">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    @if (UserContext.HasPermission(StandardPermissionProvider.RequestForAdvanceManage))
                    {
                        <td class="arrowLink">
                            @Ajax.ActionLink("Add New", "Index", new { id = "LoadORDetails" }, new AjaxOptions
                           {
                               UpdateTargetId = "tenderDiv",
                               LoadingElementId = "loading",
                               Url = Url.Action("LoadORDetails")
                           })
                        </td>
                    }
                    else
                    { 
                        <td>&nbsp;</td>
                    }
                </tr>
                <tr>
                    <td class="arrowLink">
                        @Ajax.ActionLink("View Tender Analyses", "Index", new { id = "ViewTenders" }, new AjaxOptions
                        {
                            UpdateTargetId = "tenderDiv",
                            LoadingElementId = "loading",
                            Url = Url.Action("ViewTenders"),
                            OnSuccess = "if (document.getElementById('table') != null) {initSorter();sorter.size(50);} document.getElementById('TADetailsDiv').innerHTML='';"
                        })
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <br />
    <div id="loading" style="display: none; color: Blue; font-weight: bold;">
        <img src="../../Content/images/loading_indicator.gif" alt="Processing request..." />
    </div>
    <div id="tenderDiv">
        <!-- Content goes here-->
        @Html.Action("ViewTenders")
    </div>
    <br /><br />
    <div id="TADetailsDiv">
        <!-- Content goes here-->
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        if (document.getElementById('table') != null) {
            initSorter();
            sorter.size(50);
        }
    });
</script>
